<!DOCTYPE html>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css">
<title>Captive</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>


<script>

	var init = 5;
	
	$(document).ready(
		function() {
			document.getElementById("dialog").style.display="inherit";
			document.getElementById("background").style.display="inherit";
			document.getElementById("dialog").innerHTML = "I say: <br/>What did you just say to me?";
			$("#dialog").click(dialog1);
		}
	);
	
	function dialog1()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/child.png";
		document.getElementById("dialog").innerHTML = "Jimmy says: <br/>Stephen's my friend. Don't talk to him like that!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog2);
		}
	}
	
	function dialog2()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "I shout: <br/>I can't believe this! Are you taking his side? Jimmy, have you lost your mind???";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog3);
		}
	}
	
	function dialog3()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/stephen.png";
		document.getElementById("dialog").innerHTML = "Stephen says: <br/>Shut up, old man!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog4);
		}
	}
	
	function dialog4()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById('audiotag2').play();
		document.getElementById("dialog").innerHTML = "(Stephen shoots me in the foot. I cry out in pain.)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog5);
		}
	}
	
	function dialog5()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/child.png";
		document.getElementById("dialog").innerHTML = "Jimmy says: <br/>Stephen, what did you do that for???!!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog6);
		}
	}
	
	function dialog6()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/stephen.png";
		document.getElementById("dialog").innerHTML = "Stephen says: <br/>He's making too much noise. I wanted him to stop!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog7);
		}
	}
	
	function dialog7()
	{
		$("#dialog").unbind('click');
		document.getElementById('audiotag1').play();
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "(Someone pounds on the door.)";
		setTimeout(bind_click, 3000);
		function bind_click(){
			$("#dialog").click(dialog8);
		}
	}
	
	function dialog8()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/police.png";
		document.getElementById("dialog").innerHTML = "Policeman says: <br/>This is police! I heard a gun shot! Drop your weapon and open the door!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog9);
		}
	}
	
	function dialog9()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/stephen.png";
		document.getElementById("dialog").innerHTML = "Stephen says: <br/>Damn!!!";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog10);
		}
	}
	
	function dialog10()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/child.png";
		document.getElementById("dialog").innerHTML = "Jimmy says: <br/>What are we going to do????";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog11);
		}
	}
	
	function dialog11()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "(The policeman breaks through the door)";
		setTimeout(bind_click, 1000);
		function bind_click(){
			$("#dialog").click(dialog12);
		}
	}
	
	function dialog12()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/police.png";
		document.getElementById("dialog").innerHTML = "Policeman shouts: <br/>DON'T MOVE AND DROP YOUR WEAPON!! I SAID DROP YOUR WEAPON!!";
		setTimeout(bind_click, 1000);
		function bind_click(){ 
			$("#dialog").click(dialog13);
		}
	}
	
	function dialog13()
	{
		$("#dialog").unbind('click');
		document.getElementById("peopleimage").src="images/blank.png";
		document.getElementById("dialog").innerHTML = "(Jimmy freaks out and starts screaming. Stephen freezes and forgets the weapon is in his hand...)";
		setTimeout(bind_click, 1000);
		function bind_click(){ 
			$("#dialog").click(dialog14);
		}
	}
	
	function dialog14()
	{
		$("#dialog").unbind('click');
		document.getElementById('audiotag2').play();
		document.getElementById("dialog").style.display="none";
		setTimeout(bind_click, 3000);
		function bind_click(){ 
			dialog15();
		}
	}
	
	function dialog15()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").style.display="inherit";
		document.getElementById("dialog").innerHTML = "(I see Stephen collapsing to the floor. Jimmy is crying and screaming on the floor out of fear.)";
		setTimeout(bind_click, 1000);
		function bind_click(){ 
			$("#dialog").click(dialog16);
		}
	}
	
	function dialog16()
	{
		$("#dialog").unbind('click');
		document.getElementById("dialog").innerHTML = "I say: <br/>Jimmy, stop crying!! Everything is fine now!!";
		setTimeout(bind_click, 1000);
		function bind_click(){ 
			$("#dialog").click(dialog17);
		}
	}
	
	function dialog17()
	{
		$("#dialog").unbind('click');
		$("#dialog").fadeOut(5000,nextscene);
	}
	
	
	
	function nextscene()
	{
			window.location = "end7-1.php";
	}
	
	
</script>



</head>

<body>


<div id="container">
	<div id="background"><img src="images/basement.jpg" /></div>
	<div id="dialog">
	</div>
	<div id="people"><img id="peopleimage" src=""></div>
</div>

<audio id="audiotag1" src="audios/pound.mp3" preload="auto"></audio>
<audio id="audiotag2" src="audios/gunshot.mp3" preload="auto"></audio>

</body>
</html>